home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 26.zip / BS1 part 26 / Powervisor v1.10b disk2.adf / TheWizardCorner.lzh / TheWizardCorner next >
Text File  |  1991-09-29  |  83KB  |  1,624 lines

  1. *-----------------------------*
  2. * Reference : TheWizardCorner * Sun Sep 29 10:19:43 1991
  3. *-----------------------------*
  4.  
  5. -----------------------------------------------------------------------------
  6. WARNING !!! ONLY READ IF YOU THINK YOU ARE VERY EXPERIENCED WITH POWERVISOR !
  7. -----------------------------------------------------------------------------
  8.  
  9.  
  10. ============================== Introduction ==================================
  11.  
  12. This file contains all information for the experienced script writer.
  13. It explains the powerful 'pvcall' command and lists the contents of
  14. some internal PowerVisor data structures. With the information contained
  15. in this file in combination with the 'Scripts' tutor file you make very
  16. powerful scripts. Some examples are given in the 'Source' subdirectory.
  17.  
  18.  
  19. Note that there are include files (both .h and .i) for all
  20. structures given in this file. These include files can be found in the
  21. PVDevelop/include/PV subdirectory.
  22.  
  23. For SAS/C users there is also 'PVCallStub.lib'. Using this library
  24. you can more easily call the pvcall routines from C. You can find this
  25. library in PVDevelop/lib.
  26.  
  27. If you want some examples you can look in the 'Source' subdirectory.
  28. This directory contains sources in C and machinelanguage using the
  29. PVCallTable and other internal variables.
  30.  
  31.  
  32. ========================== The 'PVCall' command ==============================
  33.  
  34. The 'pvcall' command can be used to access ²internal variables and to
  35. install some extra features. The first argument of 'pvcall' is the
  36. number of the function you want to use (see below for a list of all
  37. functions). After this number follow the extra arguments (if any).
  38. Note that not all 'pvcall' functions are callable from within PowerVisor.
  39. Some are only intended to be called from within a ²machinelanguage script.
  40. To call a 'pvcall' function from within a machinelanguage script you can
  41. use the ¹PVCallTable (offset 34 in the ¹PowerVisor-port). This is a pointer
  42. to the table containing all pointers to the 'pvcall' functions. The pointer
  43. to the PVCallTable is also automatically available if your machinelanguage
  44. routine is executed from within PowerVisor (in register a2) (see the
  45. 'Scripts' tutor file for more information about machinelanguage scripts).
  46. The ²return value from these functions is always in d0.
  47. If a certain pvcall function is only available from machinelanguage an
  48. asterix ('*') is put after the number. All functions callable
  49. from both machinelanguage and PowerVisor expect their arguments on a
  50. commandline. If you want to use any of these functions in machinelanguage
  51. you have to build a commandline and provide the pointer to it in a0.
  52. Except for the 'Install<xxx>Cmd' functions ('Pre' command, 'Post' command,
  53. 'Quit' command and 'Snap' command)
  54. all functions preserve registers d2-d7 and a2-a6. The 'Instal<xxx>Cmd'
  55. functions preserve d2-d7 and a3-a6.
  56.  
  57.  
  58.    Number   Function
  59. ------------------------------------------------------------------------------
  60.    0        Create a new ²PowerVisor function
  61.                <name>
  62.                <address of routine>
  63.                   this is a pointer to a machinelanguage routine. When this
  64.                   routine is called, a0 points to the arguments and a2 points
  65.                   to the 'PVCallTable'.
  66.  
  67.    1        Generate an ¹error
  68.                <error number>
  69.  
  70.    2        Advance ²history buffer one line. Nothing happens if this line is
  71.             the last. This function updates 252:4 in MainBase.
  72.  
  73.    3        Lower ²history buffer one line. Nothing happens if this line is
  74.             the first. This function updates 252:4 in MainBase.
  75.  
  76.    4        Get ³current history line and copy to ²stringgadget buffer.
  77.             The current history line is the line pointed to by 252:4 in
  78.             MainBase. If 252:4 is 0 the stringgadget buffer is cleared.
  79.  
  80.    5        Refresh the ¹stringgadget. Use this function after you have changed
  81.             something in the ²stringgadget buffer.
  82.  
  83.    6        Install a 'Pre' command. This is a command that is executed
  84.             before the commandline is parsed that is just typed in by
  85.             the user. The command can find the pointer to the commandline
  86.             in 'ScreenBase' (the stringgagdet buffer) and can make changes.
  87.             See the 'TechnicalInfo' file for the exact moment of the
  88.             execution of this command. When you generate an error in the
  89.             'Pre' command, you will prevent further execution (The user can
  90.             override both the 'Pre' and 'Post' commands with the '\' prefix
  91.             commandline operator).
  92.                <commandstring>
  93.  
  94.    7*       Evaluate an expression.
  95.             All expression features that PowerVisor supports are supported
  96.             by this function (even groups).
  97.                <a0 = pointer to expression>
  98.                -> <a0 = pointer after expression or 0 if error (flags)>
  99.                -> <d0 = resulting value>
  100.  
  101.    8        Remove a variable, special variable, constant or function.
  102.             Be careful with this command since you can remove internal
  103.             variables like 'rc', 'mode' and 'error' with this function.
  104.             Removing these variables will certainly do no good.
  105.                <name>
  106.  
  107.    9*       Parse a string from the commandline.
  108.             The '\' and '·' (strong quote) operators are supported.
  109.             Note that you are NOT responsible for freeing the string.
  110.             The string is automatically added to the autoclear list.
  111.             This also means that you must copy the string if you want
  112.             to remember it permanently.
  113.                <a0 = commandline>
  114.                -> <a0 = pointer after string or 0 if error (flags)>
  115.                -> <d0 = pointer to string>
  116.  
  117.    10       Copy string to the ²stringgadget buffer
  118.                <string>
  119.  
  120.    11       Add string to the ²history buffer. Note that the PowerVisor
  121.             history buffer never contains two equal history lines after
  122.             each other. This function checks if the previous history line
  123.             is equal to the one you are going to add. If they are equal
  124.             nothing happens
  125.                <string>
  126.  
  127.    12       Get address of the ²stringgadget buffer
  128.                -> <address>
  129.  
  130.    13       Append string to the ²stringgadget buffer
  131.                <string>
  132.  
  133.    14       ²Skip spaces. This command skips all spaces in a string (',' chars
  134.             are also considered spaces).
  135.                <string>
  136.                -> <pointer to first non space character>
  137.  
  138.    15       Set ²cursor position in ¹stringgadget. Use this command to set the
  139.             cursor position where it must be the next time a 'Scan' is
  140.             executed. The internal 'Scan' routine is called to get the
  141.             commandline and for the 'scan' command.
  142.                <position>
  143.  
  144.    16       Install a 'Post' command. This is a command that is executed
  145.             after the commandline is parsed and executed that was typed
  146.             in by the user.
  147.                <commandstring>
  148.  
  149.    17       Set debug mode for PowerVisor.
  150.             When debug mode is on, PowerVisor prints each command before
  151.             it is executed (after alias expansion) and also prints
  152.             the return code of each command. This is useful for debugging
  153.             recursive aliases, scripts, macros and other special
  154.             things.
  155.                <debug number> = 0 for no debug, 1 for debugging info
  156.  
  157.    18       Get ²execution level
  158.                -> <execlevel>
  159.                      0  = commandline
  160.                      1  = script
  161.                      2  = attach (IDC)
  162.                      3  = 'for' command
  163.                      4  = 'to' command
  164.                      5  = 'with' command
  165.                      6  = 'tg' command
  166.                      7  = 'on' command
  167.                      8  = refresh
  168.                      9  = group command
  169.                      10 = snap command
  170.                      11 = intuition handler command
  171.                      12 = quit handler command
  172.                      13 = signal handler command
  173.                      14 = OBSOLETE
  174.                      15 = called from 'ExecCommand' portprint function
  175.                      16 = Pre command
  176.                      17 = Post command
  177.  
  178.    19       OBSOLETE
  179.  
  180.    20       Get ¹mStringInfo. Note that when you change something in this
  181.             structure, you will probably have to call 'pvcall 52' or
  182.             'pv 5' to remake the ¹stringgadget.
  183.                -> <pointer to StringInfo>
  184.                   Fields in the StringInfo structure.
  185.                      offs  size  function
  186.                      ----------------------------------
  187.                      0     4     Buffer
  188.                      4     4     UndoBuffer
  189.                      8     2     BufferPos
  190.                      10    2     MaxChars
  191.                      12    2     DispPos
  192.                      14    2     UndoPos
  193.                      16    2     NumChars
  194.                      18    2     DispCount
  195.                      20    2     CLeft
  196.                      22    2     CTop
  197.                      24    4     LayerPtr
  198.                      28    4     LongInt
  199.                      32    4     AltKeyMap
  200.  
  201.    21       Get ²Snap Buffer. This buffer is 120 bytes long.
  202.                -> <pointer to snap buffer>
  203.  
  204.    22       Install command before ¹'snap'. Using 'pvcall 21' you can change
  205.             something in the string that is snapped. If you return 0 from this
  206.             command the 'snap' will not happen.
  207.                <commandstring>
  208.  
  209.    23       OBSOLETE
  210.  
  211.    24       ¹Beep
  212.                <period>
  213.                <time>
  214.  
  215.    25       Get address of ¹variable or ¹function
  216.                <variable name>
  217.                -> <address or null if it does not exists>
  218.  
  219.    26       OBSOLETE (Since V1.10)
  220.  
  221.    27       Create ¹constant
  222.                <name>
  223.                <value>
  224.  
  225.    28       Compare two strings
  226.                <pointer to string 1>
  227.                <pointer to string 2>
  228.                <length>
  229.                -> -1 if equal
  230.  
  231.    29       Call ²machinelanguage script
  232.                <pointer>
  233.                   Routine is called with a0 the pointer to the rest of the
  234.                   commandline, a1 the pointer to the ²RC variable, a2 the pointer
  235.                   to the ¹PVCallTable and d6 equal to 0 (d6 is normally the number
  236.                   of arguments but 'pvcall 29' does not allow you to give
  237.                   arguments to the routine).
  238.                   The result of this 'pvcall' is the result from the routine
  239.                   in d0.
  240.  
  241.    30       ¹EvalBase
  242.                -> <EvalBase>
  243.  
  244.    31       ¹ARexxBase
  245.                -> <ARexxBase>
  246.  
  247.    32       ¹DebugBase
  248.                -> <DebugBase>
  249.  
  250.    33       ¹FileBase
  251.                -> <FileBase>
  252.  
  253.    34       ¹GeneralBase
  254.                -> <GeneralBase>
  255.  
  256.    35       ¹ListBase
  257.                -> <ListBase>
  258.  
  259.    36       ¹MainBase
  260.                -> <MainBase>
  261.  
  262.    37       Routines. You may change this ²routine table but if you do so you
  263.             must make sure that the list remains sorted (at least sorted for
  264.             the first letter).
  265.             Note that this table is actually points into the RexxList
  266.             table containing all Rexx commands (see 'pvcall 39').
  267.             Note that <type> is not used by PowerVisor but is used by
  268.             the ARexx interpreter
  269.                -> <pointer to routine table>
  270.                      <pointer to string>.L <type>.L <pointer to routine>.L
  271.                      .
  272.                      .
  273.                      .
  274.                      0.L 0.L
  275.  
  276.    38       ¹ModeRoutines. You may change this table. It should not be sorted
  277.                -> <pointer to mode routine table>
  278.                      <pointer to string>.L <pointer to routine>.L
  279.                      .
  280.                      .
  281.                      .
  282.                      0.L 0.L
  283.  
  284.    39       ¹RexxList. You may change this table. The first part of this
  285.             table consists of all PowerVisor functions. The second part
  286.             of table (also pointed to by 'pvcall 37') consists of all
  287.             PowerVisor commands.
  288.                -> <pointer to rexx command list>
  289.                      <pointer to string>.L <type>.L <pointer to routine>.L
  290.                      .
  291.                      .
  292.                      .
  293.                      0.L 0.L 0.L
  294.                   <type>
  295.                      0 = Normal function, returns number
  296.                      1 = String function, returns string
  297.  
  298.    40       ¹ScreenBase
  299.                -> <ScreenBase>
  300.  
  301.    41       ¹MemoryBase
  302.                -> <MemoryBase>
  303.  
  304.    42       OBSOLETE
  305.  
  306.    43       Get pointer to ¹stringgadget
  307.                -> <stringgadget>
  308.                   Fields in the StringGadget structure.
  309.                      offs  size  function
  310.                      ----------------------------------
  311.                      0     4     NextGadget
  312.                      4     2     LeftEdge
  313.                      6     2     TopEdge
  314.                      8     2     Width
  315.                      10    2     Height
  316.                      12    2     Flags
  317.                      14    2     Activation
  318.                      16    2     GadgetType
  319.                      18    4     GadgetRender
  320.                      22    4     SelectRender
  321.                      26    4     GadgetText
  322.                      30    4     MutualExclude
  323.                      34    4     SpecialInfo
  324.                      38    2     GadgetID (not used by PowerVisor)
  325.                      40    4     UserData (not used by PowerVisor)
  326.  
  327.    44       OBSOLETE
  328.  
  329.    45       OBSOLETE
  330.  
  331.    46*      ²Error handler. The error handler executes a routine (pointer
  332.             in a5). If there is any error in the routine, control will return
  333.             back to after the call of this routine (the 'Z' flag will be set
  334.             to indicate that there was an error). All registers are preserved
  335.             for the routine.
  336.                <a5 = pointer to routine>
  337.  
  338.    47       Install a command that will be executed before ²PowerVisor quits.
  339.             Using this function you can ³cleanup your memory before it is
  340.             too late. If you return 0 from this function the quit will not
  341.             happen.
  342.                <commandstring>
  343.  
  344.    48       Search the ²alias list and return the converted command. If the
  345.             command is not in the alias list the original commandline is
  346.             returned. Note that this function always returns a pointer to
  347.             a new string. You must free this string later with 'pvcall 51'.
  348.                <string>
  349.                -> <new string> (PV block)
  350.  
  351.    49*      Add a ²memory region allocated with 'pvcall 50' to the
  352.             ²autoclear list. The autoclear list contains at most 10
  353.             (by default, you can change this value in 'MemoryBase')
  354.             allocations. If more than 10 allocations are added the
  355.             last allocation (timewise) is removed and freed. This means
  356.             that this method is not absolutely safe, but safe enough
  357.             for most purposes. The autoclear list is mostly used for
  358.             strings.
  359.             Note that it is not possible to remove something from this
  360.             list. This means that once some pointer is added you may never
  361.             free the pointer yourselves.
  362.             PowerVisor also frees all memory in this list before quiting.
  363.             Note that PowerVisor uses this list for all strings and string
  364.             pointers the user uses.
  365.                <d0 = pointer>
  366.                -> Z flag is set if there was an error
  367.  
  368.    50*      Allocate a block of memory. The ¹memoryblock allocated with this
  369.             function is called a ²PV block (do not confuse with ²PV memoryblock
  370.             since this is something completely different). A PV block is a
  371.             pointer after the size. This size is contained in a word if the
  372.             block is smaller than a 65533 bytes. Else it is containted in
  373.             a longword.
  374.             Note that you must explicitelly free this block with 'pvcall 51'
  375.             except if you add this block to the ²autoclear list with 'pvcall 49'
  376.             or to the ³global autoclear list with 'pvcall 55'.
  377.                <d0 = size>
  378.                -> <d0/Z flag = pointer to PV block or 0 if error>
  379.  
  380.    51*      Free a ²PV block. Do not free a PV block when it is added to the
  381.             ²autoclear list using 'pvcall 49' or when it is added to the
  382.             ³global autoclear list with 'pvcall 55'. Generally it is not safe
  383.             to free memory not allocated with 'pvcall 50' (there are
  384.             exceptions like 'pvcall 48' for example).
  385.                <a0 = pointer>
  386.  
  387.    52       Compute the ¹gadget and the ³intuition signal bits. Use this function
  388.             when you have changed something to the ²StringInfo structure or
  389.             the ²Gadget structure, or when you have changed the ²IDCMP values
  390.             for the ²PowerVisor window.
  391.  
  392.    53*      ³Print a string. The printing will stop when the 0 character is
  393.             encountered in the string or when d3 characters are printed. You
  394.             may also enclose linefeed characters in the string (ascii 10).
  395.                <a0 = pointer to string>
  396.                <d3 = length>
  397.  
  398.    54*      Print a number. Note that this function may be interrupted by
  399.             the user. If you want to be absolutely sure you should use
  400.             the errorhandler ('pvcall 46') for this routine.
  401.             Note that the previous routine ('pvcall 53') is safe and can't
  402.             be interrupted.
  403.                <d0 = number>
  404.  
  405.    55*      Add a pointer to a ²PV block to the ³global autoclear list. This
  406.             is the list where all allocations from the 'alloc' function
  407.             reside. Note that when you have added the pointer to this list
  408.             you must not forget to remove the pointer from the list when
  409.             you free the PV block with 'pvcall 51' (Use 'pvcall 56' for
  410.             this purpose). (Use the 'showalloc' command to see all
  411.             allocations in this list).
  412.                <d0 = pointer to PV block>
  413.                -> <Z flag is true if not enough memory to add it>
  414.  
  415.    56*      Remove a pointer to a PV block from the ³global autoclear list.
  416.             Note that you are still responsible for freeing the ²PV block.
  417.                <a0 = pointer to PV block>
  418.  
  419.    57*      Close a ²PV handle.
  420.             You must remember that when you close a standard PV handle (like
  421.             the PV handle for the help file), you MUST set the handle value
  422.             in the corresponding base to 0. Otherwise PowerVisor will try
  423.             to close the file again.
  424.                <d1 = pointer to PV handle>
  425.  
  426.    58*      ¹Reallocate a ³PV memory block.
  427.                <a0 = pointer to PV memory block>
  428.                <d0 = new size (if 0 block is freed)>
  429.                -> <a0 = pointer to the same PV memory block (unchanged)>
  430.                -> <d0/Z flag = pointer to memory or 0 if no success>
  431.  
  432.    59*      ¹Reallocate a ³PV quick block.
  433.                <a0 = pointer to PV quick block>
  434.                <d0 = new size (if 0 block is freed)>
  435.                -> <a0 = pointer to the same PV quick block (unchanged)>
  436.                -> <d0/Z flag = pointer to memory or 0 if no success>
  437.  
  438.    60       OBSOLETE
  439.  
  440.    61*      Refresh a logical window
  441.                <a0 = pointer to logical window>
  442.  
  443.    62*      Snap a word from a position in a logical window
  444.                <a0 = pointer to logical window>
  445.                <d0 = x position (relative to physical window)>
  446.                <d1 = y position>
  447.                <a1 = buffer for word>
  448.                <d2 = length of buffer>
  449.                -> <d0/Z flag = resulting length of buffer or 0>
  450.  
  451.    63*      Disassemble some memory
  452.                <a0 = pointer to string space (make it big enough)>
  453.                <d0 = address to disassemble>
  454.                <a6 = pointer to library (or NULL), this is in fact the
  455.                      contents of the 'a6' variable. When a6 <> 0 PowerVisor
  456.                      will disassemble library calls with the correct
  457.                      names instead of the offset>
  458.                -> <d0 = number of bytes disassembled>
  459.                -> <a0 = pointer to end of string>
  460.  
  461.    64       Disassemble some memory. Commandline version
  462.                <string pointer>
  463.                <address>
  464.                <library pointer or 0>
  465.                -> <number of bytes disassembled>
  466.  
  467.    65       Put a character on the logical window without disturbing the
  468.             rest of the line. WARNING only use this function for a VISIBLE
  469.             position on the logical window. If the real size of the logical
  470.             window is bigger than the visible size this function is rather
  471.             dangerous. This function is useful if you want to print
  472.             multicolored messages (using the 'prefs pens' command)
  473.                <character>
  474.  
  475.  
  476. ===================== Description of memory formats. =========================
  477.  
  478.    ²²PV block
  479.       A PV block is a pointer to memory. It is used quiet often.
  480.       You can use the 'pvcall 50' and 'pvcall 51' functions to
  481.       allocate or free such blocks. Be careful when you free PV blocks
  482.       that you have not allocated. If you want to be totally safe you
  483.       should always clear the variable in the appropriate base when
  484.       you free a PV block. If it is absolutely unsafe to free a certain
  485.       PV block, a warning will be given in the description (see below).
  486.       Otherwise you may assume that you can use the PV block.
  487.  
  488.                                 <Size> bytes big
  489.                                       /  \
  490.                                      /    \
  491.                                     /      \
  492.                         +--------+------------+
  493.                    +->  | <Size> | Memory ... |
  494.                    |    +--------+------------+
  495.                    |             ^
  496.                    |             |
  497.                    |       PV block points to this
  498.                    |
  499.                    +------ Size is 2 bytes or 4 bytes long
  500.                            If size is 2 bytes long the PV block will not be
  501.                            long word alligned.
  502.  
  503.    ³³PV memory block
  504.       A PV memory block is a ¹relocatable piece of memory. You can use
  505.       'pvcall 58' to manage this memory. Note that after a reallocmem
  506.       ('pvcall 58') the memory block can be moved to another place.
  507.  
  508.                                       <Size> bytes big
  509.                                             /  \
  510.                   +-----------------+      /    \
  511.                   | <Size> of block |     /      \
  512.                   +-----------------+  +------------+
  513.                   | Ptr to block    |->| Memory ... |
  514.                   +-----------------+  +------------+
  515.  
  516.    ³³PV quick block
  517.       A PV quick block is an optimized version of the PV memory block. It is
  518.       optimized for speed. A PV quick block is always allocated too big. This
  519.       has the advantage that you need less size changes of the PV quick block.
  520.       (size changes can be timeconsuming because it can happen that the memory
  521.       must be moved to another place). You can use 'pvcall 59' to manage this
  522.       memory.
  523.  
  524.                                                    <rsize> bytes big
  525.                                                          /  \
  526.              +--------------------------+               /    \
  527.              | Logical <lsize> of block |              /      \
  528.              +--------------------------+  +-------------------------------+
  529.              | Pointer to block         |->| Memory (lsize significant)... |
  530.              +--------------------------+  +-------------------------------+
  531.              | Real <rsize> of block    |
  532.              +--------------------------+
  533.  
  534.    ²²PV handle
  535.       PV handles are filehandles used by PowerVisor for ³buffered file IO.
  536.       The only operation you can do on a PV handle is 'pvcall 57'.
  537.  
  538.    ²²EXEC block
  539.       A normal block allocated with ¹AllocMem (exec).
  540.  
  541.    ²²DOS file
  542.       A normal ²DOS filehandle (BPTR).
  543.  
  544.  
  545. ================================ The bases ===================================
  546.  
  547. The rest of this file is dedicated to the internal data structures. You
  548. can get the pointers to these structures with the 'pvcall' commands.
  549. Read only fields are indicated with an asterix ('*') in front of the line.
  550. A read only field does not always mean that changing it may harm PowerVisor.
  551. It can also indicate that PowerVisor only uses the field once and changing it
  552. won't have any effect.
  553. All other fields can be modified but you must make sure that you follow
  554. the conventions: A PV block must remain a PV block and so on.
  555. You can use 'pvcall 51' to free a PV block. When there is some restriction
  556. on the use of an internal variable it is mentioned in the list.
  557.  
  558. Note that all structures described below are also available in include
  559. file form (both .h and .i include files). See the 'PVDevelop' subdirectory.
  560.  
  561.  
  562. ========================= Main Base (pvcall 36) : ============================
  563.  
  564.    Offset      Size      Function
  565. ------------------------------------------------------------------------------
  566. *  0           2         OS version (1 if 2.0 or higher)
  567. *  2           4         DosBase
  568. *  6           4         IntuitionBase
  569. *  10          4         GraphicsBase
  570. *  14          4         UtilityBase (0 in AmigaDOS 1.2/1.3 version)
  571. *  18          4         ExpansionBase
  572. *  22          4         DiskFontBase
  573. *  26          4         PowerVisorBase
  574. *  30          4         CLI commandline for PowerVisor
  575. *  34          4         CLI commandline length
  576.    38          4         Pointer to error file handle (DOS file)
  577. <  42          8         >
  578.    50          2         Speed of refresh
  579.    52          2         Refresh counter
  580.    54          4         Command that is refreshing (PV block)
  581.    58          (2+2)*6   Codes (WORD) /Qualifier (WORD) table
  582.  
  583.                            Key      Default code   Default Qualifier
  584.                            ----------------------------------------------------
  585.                            Break    ESC            none
  586.                            HotKey   /              right-shift+right-alt
  587.                            Pause    HELP           right-alt
  588.                            NextWin  TAB            none
  589.                            HistUp   UPKEY          none
  590.                            HistDo   DOWNKEY        none
  591.  
  592.                          Same keys as in 'prefs key' command
  593.    82          1         If equal to 1 we are in PowerVisor debug mode
  594.                          (see 'pvcall 17')
  595. <  83          3         >
  596.    86          4         'Pre' command (PV block)
  597.    90          4         'Post' command (PV block)
  598.    94          4         'Quit' command (PV block)
  599.    98          4         Pointer to last history string in history buffer
  600.                          (or 0 if the history buffer is empty). This is
  601.                          the first history line that is going to be deleted
  602.                          when there are too many lines in the history buffer.
  603.                          For the format of history lines see below
  604.    102         2         Last error code
  605.    104         2         Execution level (pvcall 18)
  606. *  106         (4+4)*6   Signal bitnumbers (LONG) and signal sets (LONG)
  607.  
  608.                             Hold
  609.                               Sending this singal to PowerVisor will cause
  610.                               PowerVisor to reopen it's screen after a 'hold'.
  611.                             PortPrint
  612.                               Use this signal bit in conjunction with sending
  613.                               a message on the PowerVisor port.
  614.                             IDC
  615.                               (Input Device Command) Using this signal you
  616.                               can execute IDC commands.
  617.                             GadgetRefresh (to PowerVisor.task)
  618.                               Say to PowerVisor.task that the stringgadget
  619.                               needs refreshing.
  620.                             PVtoFront (to PowerVisor.task)
  621.                               Say to PowerVisor.task that PowerVisor should
  622.                               come to the front. Sending this signal also
  623.                               causes a 'Hold' signal to PowerVisor.
  624.                             InterruptPV
  625.                               Interrupt PowerVisor.
  626.  
  627. *  154         4         PowerVisor.task
  628. *  158         4         Input request block
  629. *  162         4         Input device port
  630.    166         4         Pointer to first history line
  631.  
  632.                          The format of one history line is the following :
  633.                             <next>.L <prev>.L <Size>.W <string>
  634.                          One history line is a simple EXEC block. If you
  635.                          want to free one you must make sure that you
  636.                          use <Size>.W for size, and that the double linked
  637.                          list remains correct, 166:4 (this field) must
  638.                          point to the first history line (may be 0 if
  639.                          there are no history lines) and 98:4 must point
  640.                          to the last history line in the history buffer.
  641.                          Note that <prev>.L is 0 for the first history
  642.                          line (the one pointed to by 166:4) and <next>.L
  643.                          is 0 for the last history line (the one pointed
  644.                          to by 98:4).
  645.                          Also make sure that 252:4 (the pointer to the
  646.                          history line we are scanning) points to 0 (the
  647.                          easy way) or points to an existing history line
  648.                          (the hard way) when you delete a line.
  649.                          If you delete or add a history line you must also
  650.                          make sure to update 170:4 (this is not neccessary
  651.                          if you use the standard pvcall functions to add
  652.                          a history line)
  653.  
  654.    170         4         Number of lines in history
  655.    174         4         Maximum number of lines in history (default 20)
  656.    178         32        Code table
  657.                             Each bit in this table represents a code. If the
  658.                             bit is 1 this means that there is a macro
  659.                             with this code defined.
  660.    210         4         Pointer to first alias structure (or 0 if there
  661.                          are no aliases)
  662.                            Each alias structure looks as follows :
  663.  
  664.                            offs  size  function
  665.                            --------------------------------------------------
  666.                            0     4     Next alias string (0 for last)
  667.                            4     4     Previous alias string (0 for first
  668.                            8     4     Pointer to command string (PV block)
  669.                            12    4     Pointer to alias string (PV block)
  670.  
  671.                            It is safe to change this list and to replace
  672.                            strings as long as you respect the double linked
  673.                            list and give valid PV blocks in each structure.
  674.                            You may free the two strings (with pvcall 51)
  675.                            if you replace them with other PV blocks.
  676.                            Note that an alias structure is an EXEC block.
  677.  
  678.    214         4         Pointer to scriptline
  679.                          Make sure that you respect the maximum line length
  680.                          (see 218:2) when you change this pointer.
  681.    218         2         Default line length
  682.    220         1         Character used for comments (default ;)
  683.    221         1         Character used for feedback suppress (default ~)
  684.    222         1         Character used for quick exec (default \)
  685.    223         1         Character used to suppress output (default -)
  686.    224         1         Last command
  687.                             0 normal command
  688.                             1 memory command
  689.                             2 unasm
  690.                             3 view
  691.    225         1         Feedback mode
  692.    226         1         Autolist mode
  693. *  227         1         If 1 we are in hold mode (screens are closed)
  694. <  228         1         >
  695.    229         1         Input device command number
  696.  
  697.                            nr    name        function
  698.                            ----------------------------------------------------
  699.                            1     NEXTWIN     Make next logwin the scroll window
  700.                            2     SCROLL1UP   Scroll logwin one line up
  701.                            3     SCROLLPGUP  Scroll logwin five lines up
  702.                            4     SCROLLHOME  Scroll to home position
  703.                            5     SCROLLEND   Scroll to bottom position
  704.                            6     SCROLL1DO   Scroll one line down
  705.                            7     SCROLLPGDO  Scroll five lines down
  706.                            8     SCROLLRIGHT Scroll to the complete rightside
  707.                            9     SCROLL1RI   Scroll one column right
  708.                            10    SCROLL1LE   Scroll one column left
  709.                            11    DSCROLL1UP  Scroll debug window one word up
  710.                            12    DSCROLLPGUP Scroll debug window 20 words up
  711.                            13    DSCROLL1DO  Scroll debug window one word down
  712.                            14    DSCROLLPGDO Scroll debug window 20 words down
  713.                            15    DSCROLLPC   Scroll debug window to PC
  714.                            16    EXEC        Execute command (ptr in 230:4)
  715.                            17    SNAP        Snap string (ptr in 230:4)
  716.  
  717.    230         4         Pointer to argument for IDC command EXEC.
  718.    234         14        List containing the macros (key attachements).
  719.                          One macro node looks like this :
  720.  
  721.                            offs  size  function
  722.                            --------------------------------------------------
  723.                            0     4     ln_Succ
  724.                            4     4     ln_Pred
  725.                            8     1     ln_Type
  726.                            9     1     ln_Pri (not used)
  727.                            10    4     ln_Name (not used)
  728.                            14    2     Code for key
  729.                            16    2     Qualifier
  730.                            18    4     Commandstring (EXEC block)
  731.                            22    2     Length of command string
  732.                            24    2     Flags
  733.                                           INVISIBLE = 1  If set, command is
  734.                                              not added to stringgadget before
  735.                                              it is executed. It is executed
  736.                                              with IDC commands
  737.                                           SNAP = 2. If set, command is
  738.                                              snapped to the current position
  739.                                              in the stringgadget. Nothing
  740.                                              is executed
  741.                                           HOLDKEY = 4. If set, the attached
  742.                                              key is not removed from the
  743.                                              input event list
  744.  
  745.    248         4         Pointer to workbench message (or 0 if started
  746.                          from cli)
  747.    252         4         Pointer to history line we are scanning, if 0
  748.                          we are typing a new line or the stringgadget
  749.                          is empty (See the history variables above for
  750.                          more information).
  751.                          This pointer is used by the general input routine
  752.                          and by the input handler to scan through the
  753.                          history buffer. You can use pvcall 2 and pvcall 3
  754.                          to change this pointer or you can change it
  755.                          yourselves
  756.  
  757.  
  758. ========================= Eval Base (pvcall 30) : ============================
  759.  
  760.    Offset      Size      Function
  761. ------------------------------------------------------------------------------
  762. <  0           8         >
  763.    8           8         Variables and functions (PV memory block)
  764.                             Format for variables and functions:
  765.                                <Value or pointer>.L <Name len>.B <Type>.B
  766.                                <Name> [<pad>.B] [<spec>.L]
  767.                             <Type>
  768.                                0 = variable
  769.                                1 = constant
  770.                                2 = special
  771.                                3 = function
  772.                             <spec> is pointer to routine to call when
  773.                                variable changes (only when <Type> == 2)
  774.                          Note that you better not change the variables
  775.                          'error' and 'rc'. These should remain on the
  776.                          same position. This is because PowerVisor accesses
  777.                          these variables with a fixed offset from the start
  778.                          of the variable list.
  779.    16          18        Operator priorities
  780.                          One byte for each operator. Priorities between
  781.                          1 and 10 are supported (1 is low priority)
  782.  
  783.                          Op      Function            Default priority
  784.                          --------------------------------------------
  785.                          ^       Xor                 4
  786.                          &       And                 5
  787.                          |       Or                  3
  788.                          *       Multiply            10
  789.                          /       Divide              10
  790.                          %       Modulo              10
  791.                          +       Add                 9
  792.                          -       Subtract            9
  793.                          >       Greater than        7
  794.                          <       Less than           7
  795.                          >=      Greater or equal    7
  796.                          <=      Less or equal       7
  797.                          !=      Not equal           6
  798.                          ==      Equal               6
  799.                          <<      Left shift          8
  800.                          >>      Right shift         8
  801.                          &&      Logical and         2
  802.                          ||      Logical or          1
  803.  
  804.  
  805. ======================== ARexx Base (pvcall 31) : ============================
  806.  
  807.    Offset      Size      Function
  808. ------------------------------------------------------------------------------
  809. *  0           4         Rexx signal bit
  810.    4           2         Sync flag (if 1 we are in Sync)
  811. *  6           2         Hide flag (if 1 we are in Hide)
  812.  
  813.  
  814. ======================== Debug Base (pvcall 32) : ============================
  815.  
  816.    Offset      Size      Function
  817. ------------------------------------------------------------------------------
  818. *  0           4         If floatingpoint coprocessor present this variable
  819.                          contains 4, else 0
  820.    4           14        List containing all debug tasks.
  821.                          One debug node looks like this :
  822.  
  823.                            offs  size  function
  824.                            --------------------------------------------------
  825.                            0     4     ln_Succ
  826.                            4     4     ln_Pred
  827.                            8     1     ln_Type
  828.                            9     1     ln_Pri (not used)
  829.                            10    4     ln_Name
  830.                            14    4     MatchWord = 'DBUG'
  831.                            18    1     Mode (mode)
  832.  
  833.                                           Nr Name     Function
  834.                                           -----------------------------
  835.                                           0  NONE     Doing nothing
  836.                                           1  TRACE    Tracing
  837.                                           2  EXEC     Executing
  838.  
  839.                            19    1     SMode (special mode)
  840.  
  841.                                           Nr Name     Function
  842.                                           -----------------------------
  843.                                           0  NORMAL   Normal debugging
  844.                                           1  TTRACE   Temporary trace
  845.                                           2  CRASH    There was a crash
  846.                                           3  BREAK    There was a breakpoint
  847.                                           4  TBREAK   Break due to trace
  848.                                           5  WAIT     Waiting for PowerVisor
  849.                                           6  ERROR    There was an error
  850.  
  851.                            20    4     Pointer to loaded segment (only with
  852.                                        'debug l')
  853.                            24    4     Address of instruction to execute
  854.                            28    4     Pointer to temporary routine
  855.                            32    4     Pointer to trace exception routine
  856.                            36    4     Address to restore breakpoint
  857.                                        (only if SMode = TTRACE)
  858.                            40    4     Additional information for tracing.
  859.                            44    1     TMode (trace mode) <n> is 40:4
  860.  
  861.                                           Nr Name     Trace Function
  862.                                           -----------------------------
  863.                                           0  NORMAL   Normal
  864.                                           1  AFTER    <n> instructions
  865.                                           2  STEP     endlessly
  866.                                           3  UNTIL    until pc=<n>
  867.                                           4  REG      until register changes
  868.                                           5  COND     until condition true
  869.                                           6  BRANCH   until branch
  870.                                           7  FORCE    force tracing (trace f)
  871.                                           8  OSCALL   until OS call used
  872.                                           9  SKIP     for trace t
  873.  
  874.                           <45    1     >
  875.                            46    1     TDNestCnt
  876.                            47    1     IDNestCnt
  877.                            48    1     TaskState (TS_READY or TS_WAIT)
  878.                            49    1     Dirty. If true our debug window needs
  879.                                        full refreshing
  880.                            50    4     TC_SIGWAIT
  881.                            54    4     Crash number
  882.                            58    4     Additional argument for some trace
  883.                                        modes
  884.                            62    4     Pointer to task corresponding with debug
  885.                                        node
  886.                            66    4     Top PC visible in debug window
  887.                            70    4     Bottom PC visible in debug window
  888.                            74    2     Last line where we must dump an
  889.                                        instruction (starting with 1, relative
  890.                                        to the top of the debug logical window)
  891.                            76    32    Number of bytes for each instruction on
  892.                                        screen (32 bytes, one byte for each line)
  893.                            108   4     Initial programcounter
  894.                            112   4     Previous trapcode for task
  895.                            116   12    PV quick block for symbol values. Each
  896.                                        element in this block is a value and
  897.                                        an offset in the following string quick
  898.                                        block (8 bytes per entry).
  899.                            128   12    PV quick block containing all strings for
  900.                                        the symbols. All strings in this block
  901.                                        are null terminated.
  902.                            140   14    Breakpoint list.
  903.                           <154   2     >
  904.                           <156   4     >
  905.                           <160   2     >
  906.                           <162   1     >
  907.                           <163   1     >
  908.                            164   4     Pointer to quit code on stack.
  909.                            168   4     Original quit code. (Code that is called
  910.                                        when the task quits).
  911.                            172   4     SP
  912.                            176   4     PC
  913.                            180   2     SR
  914.                            182   15*4  Registers
  915.                           <242   16    >
  916.  
  917.                          One breakpoint node looks like this :
  918.  
  919.                            offs  size  function
  920.                            --------------------------------------------------
  921.                            0     4     ln_Succ
  922.                            4     4     ln_Pred
  923.                            8     1     ln_Type
  924.                            9     1     ln_Pri (not used)
  925.                            10    4     ln_Name (not used)
  926.                            14    2     Number
  927.                            16    4     Address of breakpoint
  928.                            20    2     Original contents of memory
  929.                            22    1     Type
  930.  
  931.                                           T  temporary breakpoint
  932.                                           t  temporary breakpoint (internal)
  933.                                           N  normal breakpoint
  934.                                           P  profile breakpoint
  935.                                           C  conditional breakpoint
  936.                                           A  break after <n> passes
  937.                                           s  temporary breakpoint (internal)
  938.                           <23    1     >
  939.                            24    4     Usage count
  940.                            28    4     Additional argument
  941.                                           conditional string if type is 'C'
  942.                                           breaknumber if type is 'A'
  943.                            32    4     Routine to jump to if a break occurs
  944.                           <36    4     >
  945.  
  946.    18          4         Current debug task
  947. <  22          16        >
  948. <  38          8         >
  949.    46          1         Show register info after each trace (default 1)
  950.    47          1         Give disassembly after each trace (default 1)
  951.    48          2         Number of lines to disassemble (default 5)
  952.    50          2         Show previous instruction after each trace (default 1)
  953.  
  954.  
  955. ========================= File Base (pvcall 33) : ============================
  956.  
  957.    Offset      Size      Function
  958. ------------------------------------------------------------------------------
  959.    0           4         Pointer to CLI outputhandle (DOS file)
  960.    4           4         Pointer to control file (PV handle)
  961.    8           4         Pointer to help file (PV handle)
  962.    12          4         Pointer to script file (PV handle)
  963.    16          4         Pointer to log file (DOS file)
  964.    20          4         Pointer to log logical window
  965.  
  966.  
  967. ======================= General Base (pvcall 34) : ===========================
  968.  
  969.    Offset      Size      Function
  970. ------------------------------------------------------------------------------
  971. *  0           4         Pointer to PowerVisor (process)
  972.    4           4         Lower bound for stack pointer when PowerVisor
  973.                          should give a 'Possible stack overflow' error.
  974.                          This pointer is 512 bytes away from the TC_SPLOWER
  975.                          value of the PowerVisor task. You can change
  976.                          this value if you think it is not safe enough or
  977.                          it is too safe.
  978.                          This bound is checked whenever a command is
  979.                          executed (a group is not a command but a group
  980.                          of commands) and in the recursive part of the
  981.                          expression evaluator.
  982. *  8           4         Trackdisk request block
  983. *  12          4         Trackdisk port
  984. *  16          4         Old ExecTrapCode
  985. *  20          4         MMUType
  986.                             0 = no MMU
  987.                             ¹68851, ¹68030 or ¹68040
  988. *  24          2         1 if ¹68020 or higher, else 0
  989. *  26          4         Block with account tasks
  990. *  30          4         Old Switch function
  991. *  34          4         Old Alert function
  992. *  38          4         Old AddTask function
  993. *  42          4         Old AutoRequest function
  994.    46          4         Stack fail level (default 40)
  995. <  50          8         >
  996.    58          14        List with freezed tasks
  997.    72          14        List with crashed tasks
  998.                          One crash node looks like this :
  999.  
  1000.                            offs  size  function
  1001.                            --------------------------------------------------
  1002.                            0     4     ln_Succ
  1003.                            4     4     ln_Pred
  1004.                            8     1     ln_Type
  1005.                            9     1     ln_Pri (not used)
  1006.                            10    4     ln_Name
  1007.                            14    4     Crashed task
  1008.                            18    4     TrapNumber
  1009.                            22    4     2ndInfo (from Alert)
  1010.                            26    1     0 if trap, 1 if guru, 2 if stack fail
  1011.                           <27    1     >
  1012.                            28    4     SP
  1013.                            32    4     PC
  1014.                            36    2     SR
  1015.                            38    15*4  Registers
  1016.  
  1017.    86          14        List with fd-files
  1018.                          One fd-file node looks like this :
  1019.  
  1020.                            offs  size  function
  1021.                            --------------------------------------------------
  1022.                            0     4     ln_Succ
  1023.                            4     4     ln_Pred
  1024.                            8     1     ln_Type
  1025.                            9     1     ln_Pri (not used)
  1026.                            10    4     ln_Name
  1027.                            14    4     Library
  1028.                            18    2     Bias
  1029.                            20    8     PV memory block containing all functions
  1030.                            28    8     PV memory block containing all strings
  1031.                            36    2     Number of functions
  1032.  
  1033.    100         14        List with functions we are monitoring (see the
  1034.                          'AddFunc' command)
  1035.                          One function node looks like this :
  1036.  
  1037.                            offs  size  function
  1038.                            --------------------------------------------------
  1039.                            0     4     ln_Succ
  1040.                            4     4     ln_Pred
  1041.                            8     1     ln_Type
  1042.                            9     1     ln_Pri (not used)
  1043.                            10    4     ln_Name
  1044.                            14    4     Library
  1045.                            18    2     Offset
  1046.                            20    4     Task to monitor (if zero, all tasks)
  1047.                            24    4     Usage count
  1048.                            28    4     Pointer to count code (EXEC block)
  1049.                            32    4     Size of count code
  1050.                            36    4     Old function to restore later
  1051.                            40    2     Type flags
  1052.  
  1053.                                           0 = Normal
  1054.                                           1 = Led
  1055.                                           2 = With register information
  1056.                                           3 = Led and register information
  1057.                                           8 = Exec
  1058.  
  1059.                            42    2     Position in following block where the
  1060.                                        last added task is added
  1061.                            44    8*4   8 pointers to the 8 last tasks using
  1062.                                        this function
  1063.                            76    8*56  All registers for each task (d0-d7/
  1064.                                        a0-a5)
  1065.                            524   4     Ptr to command
  1066.  
  1067.    114         34+6      The PowerVisor port. This is an Exec message port
  1068.                          followed by a longword containing the pointer to
  1069.                          the PVCallTable and a private word.
  1070.                          You can find the pointer to the PVCallTable at
  1071.                          offset 34 in this port.
  1072. *  154         1         'mode patch'. 0 If patch to Exec AddTask is not
  1073.                          applied. 1 if patch applied.
  1074.    155         1         Old priority (before PowerVisor set it to 4)
  1075. *  156         4         Timer device request block (for 'stack' command)
  1076. *  160         4         Timer device port
  1077.    164         4         Maximum stack usage (like 'getstack' function)
  1078.    168         4         Task we are looking at with 'stack' command
  1079.    172         4         Number of microseconds to wait
  1080.  
  1081. ========================= List Base (pvcall 35) : ============================
  1082.  
  1083.    Offset      Size      Function
  1084. ------------------------------------------------------------------------------
  1085. *  0           4         Old WindowPtr from PowerVisor process
  1086.    4           4         Prompt string
  1087.    8           2         Current list number
  1088. <  10          2         >
  1089.    12          14        List containing all structure nodes.
  1090.                          (Warning ! Structure nodes and structure definitions
  1091.                          are not the same)
  1092.                          One structure node looks like this :
  1093.  
  1094.                            offs  size  function
  1095.                            --------------------------------------------------
  1096.                            0     4     ln_Succ
  1097.                            4     4     ln_Pred
  1098.                            8     1     ln_Type
  1099.                            9     1     ln_Pri (used to sort the nodes by length
  1100.                                           of name)
  1101.                            10    4     ln_Name
  1102.                            14    4     MatchWord = 'PVSD'
  1103.                            18    4     Pointer to string block (PV block)
  1104.                            22    4     Pointer to structure definition (PV block),
  1105.                                        (see below)
  1106.                            26    2     Length of structure
  1107.  
  1108.                          Structure definitions look like this :
  1109.  
  1110.                            { <String>.L <Type>.W <Offset>.W ... } 0.L 0.L
  1111.  
  1112.                               <String> is a pointer to the string corresponding
  1113.                               with the name of a structure element.
  1114.  
  1115.                               <Type>.W can be somethine like :
  1116.  
  1117.                                  0 = byte
  1118.                                  1 = word
  1119.                                  2 = long
  1120.                                  3 = string
  1121.                                  4 = object in object (like ViewPort in Screen)
  1122.  
  1123.                               To do BPTR to APTR conversion you must add 128
  1124.                               to this word.
  1125.  
  1126.                               <Offset>.W is the offset of the element in
  1127.                               the structure.
  1128.  
  1129.    26          30*40     All infoblocks (see above) for all standard lists.
  1130.                          In the following order (size is 28*40 for AmigaDOS
  1131.                          1.3) :
  1132.  
  1133.                            Exec
  1134.                            Intb
  1135.                            Task
  1136.                            Libs
  1137.                            Devs
  1138.                            Reso
  1139.                            Memr
  1140.                            Intr
  1141.                            Port
  1142.                            Wins
  1143.                            Scrs
  1144.                            Font
  1145.                            Dosd
  1146.                            Func
  1147.                            Sema
  1148.                            Resm
  1149.                            Fils
  1150.                            Lock
  1151.                            IHan
  1152.                            FDFi
  1153.                            Attc
  1154.                            Crsh
  1155.                            Graf
  1156.                            Dbug
  1157.                            Stru
  1158.                            PubS (not in AmigaDOS 1.3 version)
  1159.                            Moni (not in AmigaDOS 1.3 version)
  1160.                            Conf
  1161.                            LWin
  1162.                            PWin
  1163.  
  1164.                          An infoblock is a description of a list.
  1165.                          One infoblock looks like this :
  1166.  
  1167.                            offs  size  function
  1168.                            --------------------------------------------------
  1169.                            0     4     Prompt string
  1170.                            4     1     Item number
  1171.                            5     1     Control byte. This byte controls how
  1172.                                        you should go to the start of
  1173.                                        the list.
  1174.  
  1175.                                           -1  = routine (like 'DosD')
  1176.                                                 6:4 is pointer to routine
  1177.                                                 to call to go to the first
  1178.                                                 element of the list
  1179.                                           -2  = structure (like 'Exec')
  1180.                                                 6:4 is pointer to pointer
  1181.                                                 to structure
  1182.                                           -3  = (like 'Fils')
  1183.                                                 6:4 is pointer to routine
  1184.                                                 to call. This routine will
  1185.                                                 do the complete list without
  1186.                                                 any intervention at all
  1187.  
  1188.                                           If Control is not equal to -1, -2
  1189.                                           or -3 the start of the list is
  1190.                                           computed as follows :
  1191.  
  1192.                                              The byte is split in two nibbles :
  1193.  
  1194.                                                    bbbbbbbb
  1195.                                                       /\
  1196.                                                      /  \
  1197.                                                     /    \
  1198.                                                   llll  rrrr
  1199.  
  1200.                                              The value in 6:4 is loaded. If
  1201.                                              'llll' is equal to 0 nothing
  1202.                                              happens with this value, if it
  1203.                                              is equal to 1 you must take the
  1204.                                              indirection one step further (take
  1205.                                              the contents of the value), if it
  1206.                                              is equal to 2 you must first convert
  1207.                                              the value from BPTR to APTR before
  1208.                                              you take the contents of this value.
  1209.  
  1210.                                              We continue with the value obtained
  1211.                                              from the previous algorithm and
  1212.                                              add 10:2 to it. Now we look at
  1213.                                              'rrrr'. If it is equal to 0 we
  1214.                                              do nothing, if it is equal to 1
  1215.                                              we take the contents of this value,
  1216.                                              if it is equal to 2 we convert the
  1217.                                              value from BPTR to APTR before
  1218.                                              we take the contents.
  1219.  
  1220.                                              Now we have computed the address
  1221.                                              of the first element in the list.
  1222.  
  1223.                            6     4     Pointer to the routine to go to the base
  1224.                                        of a list or the pointer to the base of the
  1225.                                        list (what it really is depends on
  1226.                                        the value of the control byte 5:1)
  1227.                                        The routine must return the pointer to
  1228.                                        the first list element in a2. This
  1229.                                        routine may initialize d7 for use by
  1230.                                        the next element routine (see below).
  1231.                            10    2     Offset to add to 6:4 (depending on
  1232.                                        the control byte 5:1)
  1233.                            12    4     If control byte is -2 this variable
  1234.                                        contains the pointer to the structure
  1235.                                        definition (not the node) (structure
  1236.                                        definitions are described above)
  1237.                                        If control byte is -3 this variable
  1238.                                        is not used.
  1239.                                        Else this variable contains the pointer
  1240.                                        to the routine to go to the next element
  1241.                                        in the list. This routine must preserve
  1242.                                        a0 and a1. d7 is free to be used as an
  1243.                                        external variable (may be setup by
  1244.                                        startup function). a2 is pointer to
  1245.                                        list element currently listing.
  1246.                                        This routine must return the pointer
  1247.                                        to the next element in the list in a2
  1248.                                        and set the Z flag to true if the end
  1249.                                        of the list is reached.
  1250.                            16    4     Pointer to header string
  1251.                            20    4     Pointer to format string (RawDoFMT
  1252.                                        format)
  1253.                            24    4     Argument string for 'list' command
  1254.                            28    1     Must contain 0
  1255.                            29    1     If true, 30:4 is a pointer to a structure
  1256.                                        definition (not the node) containing
  1257.                                        all the information to be printed when the
  1258.                                        'info' command is used.
  1259.                                        Else 30:4 is a pointer to a routine doing
  1260.                                        the same thing.
  1261.                            30    4     Routine or structure definition. for
  1262.                                        the 'info' command. If 0, there is no
  1263.                                        more info for this list.
  1264.                            34    4     Pointer to routine printing one line
  1265.                                        for one element of the list.
  1266.                                        This routine expects the pointer to
  1267.                                        the list element in a2.
  1268.                            38    2     Offset for the name element in
  1269.                                        the structure
  1270.  
  1271.  
  1272. ======================== Screen Base (pvcall 40) : ===========================
  1273.  
  1274.    Offset      Size      Function
  1275. ------------------------------------------------------------------------------
  1276.    0           1         Integer display mode
  1277.                             0 = hex
  1278.                             1 = decimal
  1279.                             2 = both
  1280.    1           1         Scroll mode
  1281.                             0 = no -MORE- checking
  1282.                             1 = -MORE- checking
  1283.    2           1         Add space after snap
  1284.                             0 = don't add space
  1285.                             1 = do
  1286.    3           1         LoneSpc mode
  1287.                             0 = no LoneSpc
  1288.                             1 = LoneSpc
  1289.    4           1         SBottom mode
  1290.                             0 = NoSBottom
  1291.                             1 = SBottom
  1292.    5           1         If true PowerVisor will not clear line the next
  1293.                          time 'Scan' is started.
  1294. <  6           1         >
  1295.    7           1         Interlace mode
  1296.                             0 = no interlace
  1297.                             1 = interlace
  1298.    8           1         FancyMode
  1299.                             0 = 1 bitplane
  1300.                             1 = 2 bitplanes
  1301. <  9           1         >
  1302. *  10          4         Length of stringgadget buffer line (not used)
  1303.    14          4         Pointer to stringgadget buffer
  1304.    18          2         Position of cursor in stringgadget
  1305.    20          (2*4)*6   Default sizes and parameters for each logical window
  1306.                          (like 'prefs logwin' command)
  1307.                              <columns>.W <rows>.W <mask>.W <flags>.W
  1308.                              .
  1309.                              .      (6 times for each logical window)
  1310.                              .      (Main,Extra,Refresh,Debug,PPrint,Rexx)
  1311.                              .
  1312.    68          4         Pointer to 'snap' command (PV block)
  1313. <  72          4         >
  1314. <  76          4         >
  1315.    80          4         Pointer to 'Main' physical window
  1316.                          A physical window structure looks like this :
  1317.  
  1318.                            Offs  Size  Function
  1319.                            ----------------------------------------------
  1320.                            0     4     ln_Succ
  1321.                            4     4     ln_Pred
  1322.                            8     1     ln_Type
  1323.                            9     1     ln_Pri (not used)
  1324.                            10    4     ln_Name (EXEC block)
  1325.                            14    48    NewWindow structure
  1326.                            62    4     Window
  1327.                            66    4     Signal set for IDCMP
  1328.                            70    2     Last code for VANILLAKEY
  1329.                            72    2     Last qualifier
  1330.                            74    1     LeftBorder for masterbox
  1331.                            75    1     TopBorder
  1332.                            76    1     RightBorder
  1333.                            77    1     BottomBorder
  1334.                            78    4     Pointer to masterbox
  1335.                            82    4     Pointer to Global structure
  1336.                            86    14    Logical window list
  1337.  
  1338.    84          4         Pointer to 'Main' logical window
  1339.                          A logical window structure looks like this :
  1340.  
  1341.                            Offs  Size  Function
  1342.                            ----------------------------------------------
  1343.                            0     4     ln_Succ
  1344.                            4     4     ln_Pred
  1345.                            8     1     ln_Type
  1346.                            9     1     ln_Pri (not used)
  1347.                            10    4     ln_Name (EXEC block)
  1348.                            14    4     pointer to box
  1349.                            18    2     x real coordinate (in physical window)
  1350.                            20    2     y real coordinate
  1351.                            22    2     w real width
  1352.                            24    2     h real height
  1353.                            26    2     first visible column in logical window
  1354.                            28    2     first visible row
  1355.                            30    2     current column coordinate
  1356.                            32    2     current row coordinate
  1357.                            34    2     visible width in characters
  1358.                            36    2     visible height in characters
  1359.                            38    4     flags
  1360.  
  1361.                                           1     Print on file
  1362.                                           2     Print on screen
  1363.                                           4     Enable -MORE- check
  1364.                                           8     private
  1365.                                           16    private
  1366.                                           32    Total home is equal to (0,0)
  1367.                                           64    statusline on/off
  1368.                                           128   breakcheck on/off
  1369.                                           256   auto output snap
  1370.  
  1371.                            42    8     TextAttr
  1372.                                        A TextAttr structure looks like this :
  1373.  
  1374.                                           Offs  Size  Function
  1375.                                           -------------------------------
  1376.                                           0     4     Name
  1377.                                           4     2     YSize
  1378.                                           6     1     Style
  1379.                                           7     1     Flags
  1380.  
  1381.                            50    4     Pointer to font
  1382.                            54    2     Font X character width
  1383.                            56    2     Font Y character height
  1384.                            58    2     Font baseline
  1385.                            60    4     Pointer to physical window (MainPW)
  1386.                            64    2     number of columns optimal
  1387.                            66    2     number of rows optimal
  1388.                            68    2     number of lines in buffer
  1389.                            70    2     number of columns per line in buffer
  1390.                            72    4     pointer to buffer
  1391.                                        These is a table of (72:2)+1 pointers
  1392.                                        to lines. Each line is 74:2 chars
  1393.                                        long.
  1394.                            76    4     Log file (DOS file)
  1395.                            80    2     number of lines passed (for -MORE-
  1396.                                        check)
  1397.                           <82    4     >
  1398.                           <86    4     >
  1399.                            90    1     if TRUE we are active
  1400.                            91    1     TopBorder used for statusline (10 if
  1401.                                        statusline or 0 if no statusline)
  1402.                            92    2     real top coordinate
  1403.                                        92:2 = 20:2-91:1
  1404.                            94    4     userdata (used by PowerVisor)
  1405.  
  1406.                          A box structure looks like this :
  1407.  
  1408.                            Offs  Size  Function
  1409.                            ----------------------------------------------
  1410.                            0     4     Parent box or NULL if masterbox
  1411.                            4     4     Child A (not used if box is ATOMIC)
  1412.                            8     4     Child B
  1413.                            12    4     Logical window (only if box is ATOMIC)
  1414.                            16    4     Physical window
  1415.                            20    2     Share for child A (in % x 10)
  1416.                            22    1     Type
  1417.                                           0 UPDOWN
  1418.                                           1 LEFTRIGHT
  1419.                                           2 ATOMIC
  1420.                            23    1     If true our box needs a cleanup
  1421.                            24    1     Left border for inner box
  1422.                            25    1     Top border
  1423.                            26    1     Right border
  1424.                            27    1     Bottom border
  1425.                            28    2     x position after accounting for window
  1426.                                        and inner box. These variables define
  1427.                                        the box that we really can use for
  1428.                                        output (for the logwin)
  1429.                            30    2     y
  1430.                            32    2     w
  1431.                            34    2     h
  1432.                            36    2     x1 position for scrollbar
  1433.                            38    2     y1
  1434.                            40    2     x2
  1435.                            42    2     y2
  1436.  
  1437.    88          4         Pointer to 'Refresh' logical window
  1438.    92          4         Pointer to 'Debug' logical window
  1439.    96          4         Pointer to 'Extra' logical window
  1440.    100         4         Pointer to 'PPrint' logical window
  1441.    104         4         Pointer to 'Rexx' logical window
  1442.    108         4         Pointer to current logical window
  1443.    112         2         location of horizontal prompt (default 1) relative
  1444.                          to left side of window (plus border).
  1445.    114         2         left location of stringgadget relative to
  1446.                          left side of window (plus border) (default 50).
  1447.    116         2         offset for right side of stringgadget relative
  1448.                          to the rightside of the window (default 0).
  1449.    118         4         Pointer to PowerVisor steal screen
  1450.                          This is 0 if PowerVisor is on its own screen
  1451.    122         4         Pointer to PowerVisor real screen
  1452.                          This is 0 is PowerVisor is on another screen
  1453.    126         4         IntuiMsg class
  1454.    130         2         IntuiMsg code
  1455.    132         4         IntuiMsg IAddress
  1456.    136         2         IntuiMsg MouseX
  1457.    138         2         IntuiMsg MouseY
  1458.    140         2         IntuiMsg Qualifier
  1459.    142         4         Pointer to Global
  1460.  
  1461.                            Offs  Size  Function
  1462.                            ----------------------------------------------
  1463.                            0     4     ln_Succ
  1464.                            4     4     ln_Pred
  1465.                            8     14    Physical window list
  1466.                            22    4     Pointer to active logical window
  1467.                            26    4     Signal set for all physical windows
  1468.                           <30    4     >
  1469.  
  1470. <  146         4         >
  1471. <  150         4         >
  1472.    154         (8+2)*5   For each logical window except 'Main'.
  1473.                          (Note that this area is saved with 'saveconfig',
  1474.                          so any changes you make here are permanent when
  1475.                          you make a config-file)
  1476.  
  1477.                          The first 8 bytes of each entry contain the NULL
  1478.                          terminated string used to open the logical window
  1479.                          (with the predefined command). The string can be
  1480.                          something like :
  1481.                            '0110d  ',0
  1482.                          which means :
  1483.                            go to master box
  1484.                            take child 0
  1485.                            take child 1 of this child
  1486.                            take child 1 of this child
  1487.                            taks child 0 of this child
  1488.                            open logical window down this child
  1489.                          default strings are 'u      ',0
  1490.  
  1491.                          the word after this string is the share that this
  1492.                          window should take (in percentages x10)
  1493.                          default is 300.
  1494.  
  1495.                          (Extra,Debug,Refresh,PPrint,Rexx)
  1496.  
  1497.    204         4         Startup flags. (like the 'prefs startup' command)
  1498.                            bit 0 : if true we open on workbench screen
  1499.                            bit 1 : if true we open on pv screen but with
  1500.                                    non-backdrop screen
  1501.    208         2*4       Four words describing the startup window (like
  1502.                          the 'prefs window' command).
  1503.                          (x,y,w,h)
  1504.    216         2*2       Two words describing the startup screen (like
  1505.                          the 'prefs screen' command).
  1506.                          (w,h)
  1507.    220         24        24 pens (only 19 used at this moment) for fancy
  1508.                          screens. (See the 'InstallingPowerVisor' file for
  1509.                          more information about these pens.
  1510.    244         24        24 pens for no-fancy screens.
  1511.    268         4         Pointer to current pen table (one of the above
  1512.                          tables, but you may make your own pen table and
  1513.                          let this variable point to it)
  1514.    272         6         string with -BUSY- prompt
  1515.    278         6         string with -MORE- prompt
  1516.    284         6         string with -WAIT- prompt
  1517.    290         6         string with ------ prompt
  1518.    296         4         string with ???? prompt
  1519.    300         2         feedback prompt '> '
  1520.    302         4         the locked logical window (this is the logical window
  1521.                          that is waiting for input)
  1522.    306         4         the pointer to the prompt string for the locked
  1523.                          logical window
  1524.    310         1         lock state, the state of the stringgadget for the
  1525.                          locked logical window (1 is no stringgadget, 0 is
  1526.                          normal stringgadget)
  1527.    311         1         Busy mode (0 = normal, 1 = -BUSY-, 2 = a window is
  1528.                          waiting for input)
  1529. *  312         1         GadgetExists. If 1 the stringgadget exists
  1530. <  313         1         >
  1531.    314         34        Font name (default topaz.font), area is saved with
  1532.                          the 'saveconfig' command
  1533.    348         4         Start of TextAttr. Pointer to 298:34 (fontname)
  1534.    352         4         Size of font (word), style (byte) and flags (byte)
  1535.                          This area is saved with the 'saveconfig' command
  1536.    356         2         Height of all logical window borders
  1537. <  358         2         >
  1538.    360         2         Drag tolerancy at the left of the bar between two
  1539.                          logical windows. This value indicates the amount of
  1540.                          pixels at the left side of this line that PowerVisor
  1541.                          will accept as the area used to drag this line
  1542.    362         2         Drag tolerancy at the top of the bar between two
  1543.                          logical windows
  1544.    364         2         Drag tolerancy at the right of the bar between two
  1545.                          logical windows. This amount is normally the same
  1546.                          as 344:2
  1547.    366         2         Drag tolerancy at the bottom of the bar between two
  1548.                          logical windows. This tolerancy value is normally
  1549.                          larger (or just as large) as the height of the
  1550.                          logical window border (340:2)
  1551.    368         2         Horizontal size tolerancy. This is the minimum width
  1552.                          in pixels allowed for a logical window
  1553.    370         2         Vertical size tolerancy. This is the minimum height
  1554.                          in pixels allowed for a logical window
  1555.    372         4         Pointer to requester structure allocated with
  1556.                          rtAllocRequestA in reqtools.library
  1557. *  376         4         Pointer to reqtools.library (or 0 if no reqtools
  1558.                          found)
  1559.  
  1560.  
  1561. ======================== Memory Base (pvcall 41) : ===========================
  1562.  
  1563.    Offset      Size      Function
  1564. ------------------------------------------------------------------------------
  1565.    0           4         List with all automatic clear memory. You can
  1566.                          add things to this list with 'pvcall 49'.
  1567.                          This pointer is actually the pointer to the first
  1568.                          element in the list, and the first element in the
  1569.                          autoclear list is the LAST element that was added
  1570.                          (this is the oldest entry).
  1571.                          Each entry in this list contains a pointer to the
  1572.                          next entry (at offset 0) and a pointer to a PV block
  1573.                          (at offset 4).
  1574.    4           4         Pointer to the last element in the autoclear list
  1575.                          (previous list).
  1576.    8           2         The number of entries in the autoclear list.
  1577.    10          2         The maximum number of entries in the autoclear list.
  1578.                          You change this number (default 10) but you must
  1579.                          make sure that the list contains less entries than
  1580.                          the number you supply as a maximum.
  1581.    12          12        PV quick block containing the pointers to all allocated
  1582.                          memory (with the 'alloc' function and the 'pvcall 55'
  1583.                          command).
  1584.    24          8         PV memory block for the current tag list.
  1585.                          Format for one element in this PV memory block :
  1586.  
  1587.                            <Address>.L <Bytes>.L <Type>.L <Extra>.L
  1588.  
  1589.                               <Address> is start of memory block
  1590.                               <Bytes> is number of bytes for memory block
  1591.                               <Type> is one of
  1592.  
  1593.                                  1 = BYTEASCII BA
  1594.                                  2 = WORDASCII WA
  1595.                                  3 = LONGASCII LA
  1596.                                  4 = ASCII AS
  1597.                                  5 = CODE CO
  1598.                                  6 = STRUCT ST
  1599.  
  1600.                               <Extra> is the pointer to the structure
  1601.                               definition if <Type> = 6.
  1602.  
  1603.    32          4         Number of current default tag list (0..15)
  1604.    36          16*8      16 PV memory blocks containing all tag lists.
  1605.    164         4         PV quick memory tresshold (default 256). This is
  1606.                          the extra memory that is allocated to gain speed.
  1607.                          If tresshold is bigger you loose more memory but
  1608.                          you gain speed.
  1609.    168         4         Pointer to next memory to list (with 'memory',
  1610.                          'unasm' or 'view')
  1611.    172         4         Pointer to address to continue the search with
  1612.                          'next'.
  1613.    176         4         Remaining number of bytes to search.
  1614.    180         4         Pointer to string to search (PV block).
  1615.    184         1         Long Mode
  1616.                            0 = mode byte
  1617.                            1 = mode long
  1618.                            2 = mode word
  1619.                            3 = mode ascii
  1620.    185         1         HexUnAsm mode
  1621.                            0 = don't show hex when disassembling
  1622.                            1 = show hex
  1623. <  186         9         >
  1624.